//
//  TipoPassagemDAO.m
//  ViagemBem
//
//  Created by Rodrigo Morbach on 31/10/13.
//  Copyright (c) 2013 Michel de Sousa Carvalho. All rights reserved.
//

#import "TipoPassagemDAO.h"
#import "AppDelegate.h"


@implementation TipoPassagemDAO


+ (NSArray *)listarTiposPassagem: (NSString *) tppassagem
{
    NSManagedObjectContext *context = [(AppDelegate *) [UIApplication sharedApplication].delegate managedObjectContext];
    NSFetchRequest *request = [[NSFetchRequest alloc] initWithEntityName:@"TipoPassagem"];
    request.predicate = [NSPredicate predicateWithFormat:@"tipo == %@",tppassagem];
    
   return  [context executeFetchRequest:request error:nil];
   
}


+(NSManagedObjectContext*)criarContexto{
    NSManagedObjectContext *context = [(AppDelegate *) [UIApplication sharedApplication].delegate managedObjectContext];
    return context;
}
@end
